<?php
declare (strict_types = 1);

namespace app\command;

use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use app\model\EaWxSite;
use Ritaswc\ZxIPAddress\IPv4Tool;


class Luhu extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('lh:test')
            ->setDescription('测试');
    }

    protected function execute(Input $input, Output $output)
    {
        $res = IPv4Tool::query('183.236.24.12');
        dump($res);exit;

        // $arrs = [
        //     'accessKeyId'     => 'LTAI5tPCgoiPLJ7QwiCmyjDR',
        //     'accessKeySecret' => 'C024R13PC6FB1tXd47it9yA7JCmN2H',
        //     'workspaceId'     => 'llm-0sfzzn6y5xii57',
        //     'body'            => [
        //         'query' => '请问销量前十的产品有哪些'
        //     ],
        // ];

        // dump(json_encode($arrs, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES));

        // $list = EaWxSite::field('id, views')->where('status', 1)->whereLike('views', "%k%")->select()->toArray();

        // foreach ($list as $key => $value) {

            
        //     $views = str_replace(' k', '', $value['views']) * 100;


        //     EaWxSite::where('id', $value['id'])->update(['views' => $views, 'update_time' => time()]);

        //     dump($key);
        // }

        dump('End');exit;
    }
}
